#!/usr/bin/env bash
set -euo pipefail


# Configuration for verible-verilog-format
CONFIG="--inplace --indentation_spaces=4 --column_limit=120 --assignment_statement_alignment=align --module_net_variable_alignment=align"




# 检查格式（不修改文件，只检查）
# 如果格式不符合，会返回非零值 -> CI 失败
for f in $(find . -type f \( -name "*.sv" -o -name "*.svh" \)); do
    ./verible-verilog-format --verify $CONFIG "$f" || {
    echo "❌ Format issue in: $f"
    exit 1
  }
done

  echo "✅ RTL format check passed."

